/* Vecmath.

   Copyright (C) 2001, 2002, 2003 Stefan Maierhofer.

   Written by Stefan Maierhofer <sm@cg.tuwien.ac.at>

   This file is part of Vecmath.

   Vecmath is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   Vecmath is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with Vecmath; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */

using System;

namespace Vecmath
{

    /// <summary>
    /// Ray3F.
    /// </summary>
    public struct Ray3F
    {

        public Ray3F(Pnt3F p, Vec3F v)
        {
            this.p = p;
            this.v = v;
        }

        public Pnt3F Point
        {
            get { return p; }
            set { p = value; }
        }

        public Vec3F Direction
        {
            get { return v; }
            set { v = value; }
        }

        public static explicit operator Ray3F(Ray3D r)
        {
            return new Ray3F((Pnt3F)r.p, (Vec3F)r.v);
        }

        public Pnt3F GetPointOnRay(float t)
        {
            return p + v * t;
        }

        internal Pnt3F p;
        internal Vec3F v;

    }
    
  

}
